package com.itbaizhan.clouddemooauth2server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itbaizhan.clouddemooauth2server.domain.LoginUser;
import com.itbaizhan.clouddemooauth2server.service.LoginUserService;
import com.itbaizhan.clouddemooauth2server.mapper.LoginUserMapper;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【tb_login_user】的数据库操作Service实现
* @createDate 2024-04-24 16:32:27
*/
@Service
public class LoginUserServiceImpl extends ServiceImpl<LoginUserMapper, LoginUser>
    implements LoginUserService{

    @Autowired
    private LoginUserMapper loginUserMapper;

    @Override
    public LoginUser findByUserName(String userName) {

        QueryWrapper<LoginUser> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(userName), "user_name", userName);
        LoginUser loginUser = loginUserMapper.selectOne(wrapper);
        return loginUser;
    }
}




